import { createWebHistory, createRouter, type RouteRecordRaw } from 'vue-router'
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: () => import('@/layout/Dashboard.vue'),
    redirect: '/dashboard',
    meta: {
      title: '首页',
      icon: 'HomeFilled',
      showInMenu: true,
    },
    children: [
      {
        path: 'dashboard',
        name: 'DashboardContent',
        component: () => import('@/layout/DashboardContent.vue'),
        meta: {
          title: '仪表盘',
          icon: 'Odometer',
          showInMenu: true,
        },
      },
      {
        path: 'tasks',
        name: 'Tasks',
        component: () => import('@/views/task/TaskManage.vue'),
        meta: {
          title: '爬虫任务管理',
          icon: 'Stopwatch',
          showInMenu: true,
        },
      },
      {
        path: 'files',
        name: 'Files',
        component: () => import('@/views/file/FileManage.vue'),
        meta: {
          title: '文件传输统计',
          icon: 'Histogram',
          showInMenu: true,
        },
      },
      {
        path: 'statistical',
        name: 'Statistical',
        component: () => import('@/views/system/Statistical.vue'),
        meta: {
          title: '系统监控',
          icon: 'Open',
          showInMenu: true,
        },
      },
      {
        path: 'setting',
        name: 'Setting',
        component: () => import('@/views/system/Setting.vue'),
        meta: {
          title: '系统设置',
          icon: 'Setting',
          showInMenu: true,
        },
      },
    ],
  },
]

const router = createRouter({
  history: createWebHistory(import.meta.env.VITE_BASE_ROUTER),
  routes: routes,
})

export default router
